﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Data.OleDb;
using System.Linq;
using System.Drawing;
using System.Text;
using System.IO;
using System.Threading;
using System.Windows.Forms;

using DotSpatial.Controls;
using HydroDesktop.Configuration;
using HydroDesktop.Interfaces;
using DotSpatial.Controls.Header;

namespace TimeSeriesForecastingDemo
{
    public class Main : Extension
    {

        #region Variables

        private bool isActive;

        #endregion Variables

        #region IExtension Members

        /// <summary>
        /// Fires when the plugin should become inactive
        /// </summary>
        public override void Deactivate()
        {
            App.HeaderControl.RemoveAll();

            // This line ensures that "Enabled" is set to false.
            base.Deactivate();
        }


        /// <summary>
        /// Initialize the DotSpatial plugin
        /// </summary>
        /// <param name="args">The plugin arguments to access the main application</param>
        public override void Activate()
        {
            SimpleActionItem action = new SimpleActionItem("Time Series Prediction", _startDelineate_Click);
            action.GroupCaption = "HydroAnalyzer";
            action.ToolTipText = "Using Data Mining Method to Analyze Data";
            action.SmallImage = Properties.Resources.graph.GetThumbnailImage(16, 16, null, IntPtr.Zero);
            action.LargeImage = Properties.Resources.graph;
            action.RootKey = DotSpatial.Controls.Header.HeaderControl.HomeRootItemKey;
            action.ToggleGroupKey = "tHydroAnalyzerTool";
            App.HeaderControl.Add(action);

            base.Activate();
        }

        # endregion

        #region Click Events

        private void _startDelineate_Click(object sender, EventArgs e)
        {
            frmForecastDemo dlg_3 = new frmForecastDemo();
            dlg_3.ShowDialog();
        }

        #endregion Click Events
    }

}
